home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FGL304E.ZIP;1 / EXPAS.ARJ / FGDOC / EXAMPLES / PASCAL / 13-07.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-24  |  754 b   |  42 lines

  1. program main;
  2. uses fgmain, fgmisc;
  3.  
  4. var
  5.   key, aux : byte;
  6.   old_mode : integer;
  7.   x, y     : integer;
  8.  
  9. begin
  10.   old_mode := fg_getmode;
  11.   fg_setmode(13);
  12.   fg_resize(640,400);
  13.  
  14.   fg_setcolor(2);
  15.   fg_rect(0,fg_getmaxx,0,fg_getmaxy);
  16.   fg_setcolor(15);
  17.   fg_box(0,fg_getmaxx,0,fg_getmaxy);
  18.   fg_locate(24,28);
  19.   fg_text('Press arrow keys to pan.',24);
  20.  
  21.   x := 0;
  22.   y := 0;
  23.  
  24.   repeat
  25.   begin
  26.     fg_getkey(key,aux);
  27.     if (aux = 72) and (y < 200) then
  28.       inc(y)
  29.     else if (aux = 75) and (x < 320) then
  30.       inc(x)
  31.     else if (aux = 77) and (x > 0) then
  32.       dec(x)
  33.     else if (aux = 80) and (y > 0) then
  34.       dec(y);
  35.     fg_pan(x,y);
  36.   end;
  37.   until (key = 27);
  38.  
  39.   fg_setmode(old_mode);
  40.   fg_reset;
  41. end.
  42.